home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_1.3 / Includes1.3 / include.i / exec / memory.i < prev    next >
Encoding:
Text File  |  1988-07-15  |  2.3 KB  |  90 lines

  1.     IFND    EXEC_MEMORY_I
  2. EXEC_MEMORY_I    SET    1
  3. **
  4. **    $Filename: exec/memory.i $
  5. **    $Release: 1.3 $
  6. **
  7. **    definitions for use with the memory allocator
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND    EXEC_NODES_I
  14.     INCLUDE    "exec/nodes.i"
  15.     ENDC    ; EXEC_NODES_I
  16.  
  17.  
  18. *---------------------------------------------------------------------
  19. *
  20. *   Memory List Structures
  21. *
  22. *---------------------------------------------------------------------
  23. *
  24. *   A memory list appears in two forms:     One is a requirements list*
  25. *   the other is a list of already allocated memory.  The format is
  26. *   the same, with the reqirements/address field occupying the same
  27. *   position.
  28. *
  29. *   The format is a linked list of ML structures each of which has
  30. *   an array of ME entries.
  31. *
  32. *---------------------------------------------------------------------
  33.  
  34.  STRUCTURE ML,LN_SIZE
  35.     UWORD   ML_NUMENTRIES        * The number of ME structures that follow
  36.     LABEL   ML_ME            * where the ME structures begin
  37.     LABEL   ML_SIZE
  38.  
  39.  
  40.  STRUCTURE ME,0
  41.     LABEL   ME_REQS            * the AllocMem requirements
  42.     APTR    ME_ADDR            * the address of this block (an alias
  43. *                    *    for the same location as ME_REQS)
  44.     ULONG   ME_LENGTH            * the length of this region
  45.     LABEL   ME_SIZE
  46.  
  47.  
  48. *------ memory options:
  49.  
  50.     BITDEF  MEM,PUBLIC,0
  51.     BITDEF  MEM,CHIP,1
  52.     BITDEF  MEM,FAST,2
  53.     BITDEF  MEM,CLEAR,16
  54.     BITDEF  MEM,LARGEST,17
  55.  
  56.  
  57. *------ alignment rules for a memory block:
  58.  
  59. MEM_BLOCKSIZE    EQU 8
  60. MEM_BLOCKMASK    EQU (MEM_BLOCKSIZE-1)
  61.  
  62.  
  63. *---------------------------------------------------------------------
  64. *
  65. *   Memory Region Header
  66. *
  67. *---------------------------------------------------------------------
  68.  
  69.  STRUCTURE  MH,LN_SIZE
  70.     UWORD   MH_ATTRIBUTES        * characteristics of this region
  71.     APTR    MH_FIRST            * first free region
  72.     APTR    MH_LOWER            * lower memory bound
  73.     APTR    MH_UPPER            * upper memory bound+1
  74.     ULONG   MH_FREE            * number of free bytes
  75.     LABEL   MH_SIZE
  76.  
  77.  
  78. *---------------------------------------------------------------------
  79. *
  80. *   Memory Chunk
  81. *
  82. *---------------------------------------------------------------------
  83.  
  84.  STRUCTURE  MC,0
  85.     APTR    MC_NEXT            * ptr to next chunk
  86.     ULONG   MC_BYTES            * chunk byte size
  87.     LABEL   MC_SIZE
  88.  
  89.     ENDC    ; EXEC_MEMORY_I
  90.